<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>注册</title>
	<link rel="stylesheet" href="/static/new/css/common.css">
	<link rel="stylesheet" href="/static/new/css/swiper.min.css">
	<script src="/static/new/js/jquery.js"></script>
	<script src="/static/new/js/swiper.min.js"></script>
	<link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
</head>
<body>
<div class="sectionY">
	<!--<a href="">
		<img src="/static/new/images/ak3.png" alt="" class="a1_d">
	</a>-->
	<p class="p1">注册</p>
</div>
<div class="kong1"></div>
<div class="res_section1">
	<div class="layui-form">
		<div class="admin-main layui-anim layui-anim-upbit" ng-app="hd" ng-controller="ctrl">
		<div class="f1 clearfix">
			<input type="text" class="input1" name="nickname" id="nickname" value="{$bianhao}" placeholder="请输入会员编号"/>
		</div>
		<div class="f1 clearfix">
			<input type="text" class="input1" id="mobile" name="mobile" placeholder="手机号">
		</div>
		{if $sys.code=='open'}
		<div class="f1 clearfix">
			<input type="text" name="code" class="input1"  placeholder="验证码">
			<input type="button" class="sr_btn" onclick="settime(this)" id="btn"  value="获取验证码"/>
		</div>
		{/if}
		<div class="f1 clearfix">
			<input type="password" class="input1" name="password" id="password" value="{$sys.pwd1}" placeholder="6-18位数字+字母组合密码">
			<img src="/static/new/images/register_icon_view_open.png" alt="" class="eye_btn eye_btn1">
			<img src="/static/new/images/register_icon_view_close.png" alt="" class="eye_btn eye_btn2">
		</div>
		<div class="f1 clearfix">
			<input type="password" class="input1" name="password2" id="password2" value="{$sys.pwd1}" placeholder="再次确认密码">
			<img src="/static/new/images/register_icon_view_open.png" alt="" class="eye_btn eye_btn1">
			<img src="/static/new/images/register_icon_view_close.png" alt="" class="eye_btn eye_btn2">
		</div>
		<div class="f1 clearfix">
			<input type="password" class="input1" name="twopassword" id="twopassword" value="{$sys.pwd2}" placeholder="交易密码">
			<img src="/static/new/images/register_icon_view_open.png" alt="" class="eye_btn eye_btn1">
			<img src="/static/new/images/register_icon_view_close.png" alt="" class="eye_btn eye_btn2">
		</div>
		<div class="f1 clearfix">
			<input type="password" class="input1" name="twopassword2" id="twopassword2" value="{$sys.pwd2}" placeholder="再次确认交易密码">
			<img src="/static/new/images/register_icon_view_open.png" alt="" class="eye_btn eye_btn1">
			<img src="/static/new/images/register_icon_view_close.png" alt="" class="eye_btn eye_btn2">
		</div>

	<!--	<li class="f1">
			<div class="slide_btn">
				<div class="layui-input-inline" style="width: 100%">
					<select name="province" ng-model="field.province" lay-filter="province" ng-options="v.id as v.name for v in province" ng-selected="v.id==field.province">
						<option value="">请选择省</option>
					</select>
				</div>
				<div class="layui-input-inline" style="width: 100%">
					<select name="city" id="city" ng-model="field.city" lay-filter="city" ng-options="v.id as v.name for v in city" ng-selected="v.id==field.city">
						<option value="">请选择市</option>
					</select>
				</div>
				<div class="layui-input-inline" style="width: 100%">
					<select name="district" id="district" ng-model="field.district" lay-filter="district" ng-options="v.id as v.name for v in district" ng-selected="v.id==field.district">
						<option value="">请选择县/区</option>
					</select>
				</div>
			</div>
		</li>
			<div class="f1 clearfix">
				<input type="text" class="input1" name="dizhi" id="dizhi" value="" placeholder="请输入详情地址"/>
			</div>-->
	<!--	<div class="f1 clearfix">
			<input type="text" name="username" class="input1" id="username" value="" placeholder="请输入会员姓名"/>
		</div>
		<div class="f1 clearfix">
			<input type="text" class="input1"  name="shenfenzheng" id="shenfenzheng" value="" placeholder="请输入会员身份证"/>
		</div>-->
		<div class="f1 clearfix">
			<input type="text" class="input1" name="topmobi" id="topmobi" value="{$mobile}" placeholder="请输入推荐人编号"/>
		</div>
<!--		<div class="f1 clearfix">
			<input type="text" class="input1" name="center_id" id="center_id" value="" placeholder="请输入服务中心账号"/>
		</div>-->
		{if $sys.anzhi=='open'}
		<div class="f1 clearfix">
			<input type="text" class="input1" name="fathername" id="fathername" value="" placeholder="请输入安置人账号"/>
		</div>
		<div class="f1 f9 mui-clearfix">
			<select name="treeplace" class="">
				<option value="1" >A区</option>
				<option value="2" >B区</option>
			</select>
		</div>
		{/if}
<!--		<div class="f1 clearfix">
			<select name="level" class="">
				{volist name="levels" id="value"}
				<option value="{$value.level_id}" >{$value.level_name}</option>
				{/volist}
			</select>
		</div>-->
		<div class="sub">
			<input type="submit" lay-filter="sub" lay-submit value="注册">
		</div>
		<div class="last">
			<p class="p1">
				已有账号？去
				<a href="{:url('index')}">登录</a>
<!--				<a href="{:url('xiazai/app_dol')}">下载APP</a>-->
			</p>
		</div>
	</div>
	</div>
</div>
</body>
<script src="/static/user/js/mui.min.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
	layui.use(['form', 'layer'], function () {
		var form = layui.form,$ = layui.jquery;
		// 登录提交监听
		form.on('submit(sub)', function (data) {
			var loading = layer.load(1, {shade: [0.1, '#fff']});
			$.post("{:url('regist')}",data.field,function(res){
				layer.close(loading);
				if(res.code > 0){
					layer.msg(res.msg,{time:1000,icon:1},function(){
						location.href = "{:url('index/index')}";
					});
				}else{
					layer.msg(res.msg,{time:1000,icon:2});
					$('.captcha img').attr('src','{:url("verify")}?id='+Math.random());
				}
			});
		})
	})
</script>
<script>
	$(function(){
		// 验证码
		/*	$(".sr_btn").click(function(){
                var sm = $(".sr_btn").text();
                if (sm=="获取验证码"||sm=="重新发送") {
                    var data = 60;
                    var dd = setInterval(function(){
                        if(data <= 0){
                            $(".sr_btn").text("重新发送");
                            clearInterval(dd);
                            return;
                        }
                        data--;
                        $(".sr_btn").text(data+'s')
                    },1000)
                }


            })*/
		// 密码框切换
		$(".eye_btn1").click(function(){
			$(this).hide().siblings("input").attr("type","text").siblings(".eye_btn2").show();
		})
		$(".eye_btn2").click(function(){
			$(this).hide().siblings("input").attr("type","password").siblings(".eye_btn1").show();
		})
	})
</script>
<script type="text/javascript">
	var countdown = 60;
	function settime(obj) {
		obj.setAttribute("disabled", true);
		/*ajax发短信
		 */
		var mobile=$('#mobile').val();
		if(mobile==''){
			layer.msg("请输入手机号码",{time:1000,icon:2});
			obj.removeAttribute("disabled");
			return false;
		}
		$.ajax({
			type : "POST",  //请求方式
			async:false,
			url : "{:url('duanxin2')}",  //请求路径
			dataType:"html",
			data :{mobile:mobile,type:2},
			success : function(msg) {  //异步请求成功执行的回调函数
				var jsonParseJson=JSON.parse(msg);
				if(jsonParseJson['success']==1){
					/*				layer.msg(jsonParseJson['msg'],{time:1000,icon:1},function(){
					 location.href = "{:url('jihuo')}";
					 });*/
					layer.msg(jsonParseJson['msg'],{time:1000,icon:1});
				}else{
					layer.msg(jsonParseJson['msg'],{time:1000,icon:2});
				}

			}
		});
		var id=setInterval(function() {
			if(countdown==0){
				obj.removeAttribute("disabled");
				obj.value="获取验证码";
				clearInterval(id);
			}else{
				obj.value="重新发送(" + countdown + ")";
				countdown--;
			}
		},1000);
	}

</script>
<script src="/static/common/js/angular.min.js"></script>
<script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',function($scope) {
        $scope.field = {$inf|raw};
        $scope.province = {$province|raw};
        $scope.city = {$city|raw};
        $scope.district = {$district|raw};
        layui.use(['form', 'layer'], function () {
            var form = layui.form, layer = layui.layer,$= layui.jquery;
            form.on('select(province)', function(data) {
                var pid = data.value;
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.get("{:url('getRegion')}?pid=" + pid, function (data) {
                    layer.close(loading);
                    var html='<option value="">请选择市</option>';
                    $.each(data, function (i, value) {
                        html += '<option value="number:'+value.id+'">'+value.name+'</option>';
                    });
                    $('#city').html(html);
                    $('#district').html('<option value="">请选择县/区</option>');
                    form.render()
                });
            });
            form.on('select(city)', function(data) {
                var pid = data.value;
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.get("{:url('getRegion')}?pid=" + pid, function (data) {
                    layer.close(loading);
                    var html='<option value="">请选择县/区</option>';
                    $.each(data, function (i, value) {
                        html += '<option value="number:'+value.id+'">'+value.name+'</option>';
                    });
                    $('#district').html(html);

                    form.render()
                });
            });
            form.on('submit(submit)', function (data) {
                // 提交到方法 默认为本身
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                data.field.id = $scope.field.id;
                $.post("", data.field, function (res) {
                    layer.close(loading);
                    if (res.code > 0) {
                        layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                            location.href = res.url;
                        });
                    } else {
                        layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                });
            })
        });
    });
</script>
</html>